<!-- Used by tests which only need a basic playback. -->
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <title>Basic Media Playback Test</title>
  </head>

  <body>
    <div><video autoplay preload></video></div>
  </body>

  <script type="text/javascript">
    var div = document.querySelector('div');
    var video = document.querySelector('video');

    video.addEventListener('playing', function(event) {
      // Notify PyAuto that the video has started playing..
      window.domAutomationController.send(true);
    }, false);

    function startTest(url) {
      video.src = url;
    }

    function stopTest() {
      video.src = '';
      window.domAutomationController.send(true);
    }

    function initializeTest(width, height) {
      // Setup calibration area for Jerky tool.
      div.style.width = width + 'px';
      div.style.height = height + 'px';
      div.style.backgroundColor = '#333333';
      window.domAutomationController.send(true);
    }
  </script>
</html>
